package com.zyg.DataSourcePool;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.junit.Test;

import com.zyg.tools.C3p0Util;
import com.zyg.tools.DBCPUtil;
//测试数据库连接池
public class TestJDBC {
	@Test
	public void test() {
		Connection connection = null;
		PreparedStatement ps = null;
		ResultSet rs = null;
		//获取连接对象
		//connection = DBCPUtil.getConnection();
		connection = C3p0Util.getConnection();
		try {
			ps = connection.prepareStatement("");
			//。。。。。。
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			DBCPUtil.release(connection, ps, rs);
		}
	}
}
